import cv2
import numpy as np


def cv_show(name,img):
    cv2.imshow(name,img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

img = cv2.imread('C:/Users/nic/Desktop/opencv/picture/lost.JPG')
#the original image

#average filturing
blur = cv2.blur(img,(3,3))

#boxfilter
box = cv2.boxFilter(img,-1,(3,3),normalize=True)

#boxfilter
box = cv2.boxFilter(img,-1,(3,3),normalize=False)

#gaussion filter
aussion = cv2.GaussianBlur(img,(5,5),1)

#medianBlur
median = cv2.medianBlur(img,5)

#展示所有图片
res = np.hstack((blur,aussion,median))
#res = np.vstack()
print(res)
cv_show('all_image',res)


